-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More flexible --test option #359
base: develop
Are you sure you want to change the base?
Conversation
That is a bad change. When working with test zones you want to be able to run just the specific test case and nothing else. Secondly, with that change, if Basic fails completely no other test case is run, and that is not what we want when testing and creating test zones. I am against a change that makes it impossible to run just the selected test case. |
All I'm hearing is "no" and "bad". Is there anything about this proposal that you do like? Also, I'm trying to understand your objection here. AFAICT you're saying that when a user requests that a single test case is run on a domain that doesn't fulfill the requirements posed by Basic, the requested test case still needs to run. Is that correct? And if so, could you explain why this is important, because it's not obvious to me. |
It would be good to be able to exclude test cases without creating a new profile. It would be good to be able to select two or more test cases and they are run without overlap. Sometimes it is probably good that Basic is run before a selected test.
I want to see what happens in that test case for the test zone even when there are errors. And I want minimal output without the extra output from Basic when testing test zones. Sometimes I have to run with Give the possibility to run a test without adding Basic. If Basic is not in the profile, why should Basic still be run? The magic could rather be to put the Basic test cases in the profile first, if there are any. |
Ok. Yeah, I see how this could be very valuable in development contexts. And I also don't particularly like that Basic is forced. I have an idea of how we could simplify things in Engine in a way that supports this. I think I'll make a draft PR there too. I won't make any more updates to the code here before Engine is in a better shape to support it. But if anyone has more feedback on the direction of this PR, please let me know. Maybe it'll affect the updates in Engine. |
@mattias-p, is this still relevant or can it be closed now? |
This conflicts with #371 as well as some of its documentation improvement followups. I plan to rebase this PR once those things have been merged. It seems somewhat unreasonable to get this merged for 2024.2 so I postponed it. |
ecf71b3
to
b316e12
Compare
5ebbad5
to
7690a3c
Compare
7690a3c
to
b536acf
Compare
I rebased this onto latest develop and fixed some typos added some unit tests. I also tightened some validations for sanity reasons, but that shouldn't have any effect on zonemaster-cli behavior. |
This is not true anymore. Please update description.
|
Do ---> No Do ---> No |
|
||
=item --test=B<nameserver> | ||
|
||
runs the entire Nameserver test module, and nothing else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runs the entire Nameserver test module, and nothing else. | |
runs the entire Nameserver test module, including any test cases | |
disabled by the profile, but nothing else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the documentation should make this clear, but I don't think it needs to be repeated for every example. I'll add a separate paragraph clarifying how it interacts with other options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could be fine too.
runs the entire DNSSEC test module except the DNSSEC05 test case, and nothing | ||
else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runs the entire DNSSEC test module except the DNSSEC05 test case, and nothing | |
else. | |
runs the entire DNSSEC test module including any test cases | |
disabled by the profile, except the DNSSEC05 test case, | |
and nothing else. |
script/zonemaster-cli
Outdated
@@ -114,14 +114,50 @@ Print the effective profile used in JSON format, then exit. | |||
=item B<--test>=TESTCASE, B<--test>=TESTMODULE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=item B<--test>=TESTCASE, B<--test>=TESTMODULE | |
=item B<--test>=TESTCASE, B<--test>=TESTMODULE, B<--test>=EXPR |
=item --test=B<-dnssec> | ||
|
||
removes all test cases of the DNSSEC module from the set of tests that would | ||
otherwise have run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise have run. | |
otherwise have run, i.e. the test cases enabled by the profile. |
=item --test=B<+syntax01+syntax02> | ||
|
||
adds the Syntax01 and Syntax02 test cases to the set of tests that would | ||
otherwise have run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise have run. | |
otherwise have run, i.e. the test cases enabled by the profile. |
runs all test cases of all test modules except for the Nameserver test module in | ||
which only the Nameserver03 test case is run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runs all test cases of all test modules except for the Nameserver test module in | |
which only the Nameserver03 test case is run. | |
runs all defined test cases of all defined test modules (disregardning the profile) | |
except for the Nameserver test module in which only the Nameserver03 test | |
case is run. |
Nice to have it consistent. Nice to be able to control what test cases to run without creating a custom profile. |
Fixing.
Agreed. In case you modify the |
Co-authored-by: Mats Dufberg <mats.dufberg@iis.se>
Co-authored-by: Mats Dufberg <mats.dufberg@iis.se>
I think the current implementation is flawed regarding the interpretation of this command sequence: printf "%s\n" "--test=-delegation01" > ~/.zonemaster/cli.args
zonemaster-cli example.com
zonemaster-cli --test=-delegation02 example.com With the current proposal, in the first command delegation01 would be disabled, but in the second command it would be enabled again. This is because the second command would effectively be |
I think it is correct that |
We have two kinds of option today: overwriting ones and aggregating ones. Most of our options overwrite, but --test, --ns and --ds aggregate. I'm arguing that it makes more sense to keep --test as an aggregating option than to change it into an overwriting one. I.e., |
I pushed an update makes --test aggregate again. It's in a separate commit in case you want to play with both the overwriting version and the aggregating one. The man page needs an update to clarify the semantics in of repeated --test options but I haven't got around to that. I haven't forgotten your unresolved review comments, @matsduf. It's just that before I take care of them I want to settle this overwriting/aggregating business. |
There is a clear difference between Options Option |
I guess the aggregate version could work too, but it is quite complex and requires updated documentation that clearly states how it should work.
Also on the command line, |
Purpose
This PR implements flexible command line overriding of which test cases to run from the command line.
Context
This is an extension to the improvements in Extend --test option to allow passing only a testcase #333.
Replaces Better performance when running specified test. Function to exclude tests #130. The point of that PR is to allow users to exclude test cases from the command line. This PR includes the same functionality using a different command line syntax.
Leverages Ability to run single testcase via test_zone() zonemaster-engine#1312 to properly handle the Basic test module (c.f. Better performance when running specified test. Function to exclude tests #130 (comment)).
Handles the interaction of
--test
and--profile
in accordance with Better performance when running specified test. Function to exclude tests #130 (comment).For what it's worth, the idea for this design came to me in a discussion about Refactoring of function Zonemaster::Engine::Test::run_one() zonemaster-engine#1294.
Changes
The set of values accepted by
--test
is extended.The semantics are changed of repeated
--test
options. They used to be cumulative but now the last one takes precedence.Which test cases to include in the run is now controlled by setting the
test_cases
profile property and running Zonemaster::Engine->test_zone().When
--test=basic
or--test=basic02
is specified, and basic02 considers the domain too broken to test, a CANNOT_CONTINUE message is now emitted, whereas it wasn't emitted before this PR.Reviewing
All updates for this PR are contained in the very last commit. The commits before the last one all belong to Organize --help text #389 and should be disregarded when reviewing this PR.
Look especially for lacking test coverage.
Testing